package cloud.xiguapi.ubas.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @author 大大大西西瓜皮🍉
 * date: 2021-5-18 下午 05:21
 * desc:
 */
@Configuration
public class KafkaConfiguration {

    @Bean("kafkaProperties")
    public Properties kafkaProperties() {
        // 定义Kafka的Properties
        Properties properties = new Properties();
        properties.setProperty("bootstrap.servers", "localhost:9092");
        properties.setProperty("group.id", "consumer-group");
        properties.setProperty("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        properties.setProperty("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        properties.setProperty("auto.offset.reset", "latest");

        return properties;
    }
}
